<template>
  <div id="test">
    <p>这里是{{ this.name }}的路由</p>
    <span>
      <img src="../assets/xu.webp" alt="" />
    </span>
    <br />
    <!-- 以下为ElementUI一个按钮的组件引入 -->
    <el-button @click="show = !show">点击</el-button>

    <div style="display: flex; margin-top: 20px; height: 100px">
      <transition name="el-fade-in-linear">
        <div v-show="show" class="transition-box">这是</div>
      </transition>
      <transition name="el-fade-in">
        <div v-show="show" class="transition-box">ElementUI测试</div>
      </transition>
    </div>
    <!-- 上方为ElementUI一个按钮的组件引入 -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "陈宇",
      show: true,
    };
  },
};
</script>

<style lang="scss" scoped>
#test {
  text-align: center;
  p {
    font-size: 5rem;
  }
  span {
    display: inline-block;
    height: 700px;
    overflow: hidden;
  }
}
.transition-box {
  margin-bottom: 10px;
  width: 200px;
  height: 100px;
  border-radius: 4px;
  background-color: #409eff;
  text-align: center;
  color: #fff;
  padding: 40px 20px;
  box-sizing: border-box;
  margin-right: 20px;
}
</style>
